import request from '@/utils/request'

// /所属管廊下拉列表
export const commonPipeNameDrop = () => {
  return request({
    url: '/opermgt/universalMethod/getPipeInfoList'
  })
}
//防火分区下拉列表
export const commonsubregionIdDrop = () => {
  return request({
    url: '/opermgt/universalMethod/getSubregionInfoList'
  })
}
//所属仓库下拉列表
export const commonwarehouseIdDrop = () => {
  return request({
    url: '/opermgt/universalMethod/getStorehouserList'
  })
}

export const commonworktyprDrop = (params) => {
  return request({
    url: '/opermgt/dict/queryByType',
    method: 'POST',
    data: params
  })
}
//获取工单管理表
export const workorderList = (params, page, size) => {
  return request({
    url: `/opermgt/ticketsRegulate/search/${page}/${size}`,
    method: 'POST',
    data: params
  })
}
/**
 * 工单管理表保存
 * @param {*} data
 * @returns
 */
export const workorderSave = (data) => {
  return request({
    url: '/opermgt/ticketsRegulate',
    method: 'POST',
    data: data
  })
}
//工单管理删除
export const workorderDel = (id) => {
  return request({
    url: `/opermgt/ticketsRegulate/${id}`,
    method: 'DELETE'
  })
}
//工单管理获取新增编码
export const getNewCode = () => {
  return request({
    url: '/opermgt/ticketsRegulate/getNewCode',
    method: 'POST'
  })
}

//获取施工管理表
export const constructionList = (params, page, size) => {
  return request({
    url: `/opermgt/constructionAdmin/search/${page}/${size}`,
    method: 'POST',
    data: params
  })
}
/**
 * 施工管理表保存
 * @param {*} data
 * @returns
 */
export const constructionSave = (data) => {
  return request({
    url: '/opermgt/constructionAdmin',
    method: 'POST',
    data: data
  })
}

//施工管理删除
export const constructionDel = (id) => {
  return request({
    url: `/opermgt/constructionAdmin/${id}`,
    method: 'DELETE'
  })
}

//获取能耗管理表
export const energyList = (params, page, size) => {
  return request({
    url: `/opermgt/energyManagement/search/${page}/${size}`,
    method: 'POST',
    data: params
  })
}
//能耗管理删除
export const energyDel = (id) => {
  return request({
    url: `/opermgt/energyManagement/${id}`,
    method: 'POST'
  })
}
/**
 * 能耗管理表保存
 * @param {*} data
 * @returns
 */
export const energySave = (data) => {
  return request({
    url: '/opermgt/energyManagement',
    method: 'POST',
    data: data
  })
}

//作业票证查询列表
export const ListJobticket = (data) => {
  return request({
    url: '/opermgt/file/ticket/queryList',
    method: 'POST',
    data: data
  })
}
//作业票证删除
export const JobticketDel = (id) => {
  return request({
    url: `/opermgt/file/delete/${id}`,
    method: 'POST'
  })
}
/**
 * 作业票证保存
 * @param {*} data
 * @returns
 */
export const JobticketSave = (params) => {
  return request({
    url: '/opermgt/file/ticket',
    method: 'POST',
    data: params
  })
}
//维修保养表分页查询
export const repairInfoList = (params, page, size) => {
  return request({
    url: `/opermgt/repairInfo/search/${page}/${size}`,
    method: 'POST',
    data: params
  })
}
//管廊位置列表
export const pipelist = () => {
  return request({
    url: '/opermgt/universalMethod/getPipeInfoList',
    method: 'GET'
  })
}
//仓室位置列表
export const warehouselist = () => {
  return request({
    url: '/opermgt/universalMethod/getStorehouserList',
    method: 'GET'
  })
}
//防火区位置列表
export const fireprooflist = () => {
  return request({
    url: '/opermgt/universalMethod/getSubregionInfoList',
    method: 'GET'
  })
}
// 管线入廊管理列表查询
export const pipemanage = (params, page, size) => {
  return request({
    url: `/opermgt/pipelineApply/selectList/${page}/${size}`,
    method: 'POST',
    data: params
  })
}
//管线类型列表
export const pipeTypelist = () => {
  return request({
    url: '/opermgt/pipelineApply/selectType',
    method: 'GET'
  })
}
// // 维修计划新增列表
// export const repairAdd = () => {
//   return request({
//     url: '/opermgt/maintainPlan/search',
//     method: 'POST'
//   })
// }
